package me.zhengjie.modules.system.service.mapstruct;

import me.zhengjie.base.BaseMapper;
import me.zhengjie.modules.system.domain.SafeRiskItem;
import me.zhengjie.modules.system.service.dto.SafeRiskItemDto;
import me.zhengjie.modules.system.service.mapstruct.convertor.impl.SafeRiskItemConvertor;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;

/**
 * SafeRiskItemMapper
 *
 * @author guoyuan
 * @version 1.0.0
 * @since 1.0.0
 */
@Mapper(componentModel = "spring", uses = {SafeRiskItemConvertor.class}, unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface SafeRiskItemMapper extends BaseMapper<SafeRiskItemDto, SafeRiskItem> {
    /**
     * DTO转Entity
     *
     * @param dto /
     * @return /
     */
    @Override
    @Mapping(target = "sceneType", source = "sceneType", qualifiedByName = "sceneType2Code")
    SafeRiskItem toEntity(SafeRiskItemDto dto);

    /**
     * Entity转DTO
     *
     * @param entity /
     * @return /
     */
    @Override
    @Mapping(target = "sceneType", source = "sceneType", qualifiedByName = "sceneType2Value")
    SafeRiskItemDto toDto(SafeRiskItem entity);
}
